1. Technical Field
The disclosure relates to a network interface controller (NIC), and more particularly to an NIC capable of sharing buffers and a buffer sharing method.
2. Related Art
A conventional network interface controller (NIC) has transmission and reception functions, and is used for receiving data in a network environment and transmitting data to a network environment. A transmitting end and a receiving end of the NIC both have a dedicated buffer, constituting a transmitting buffer and a receiving buffer, respectively.
For a circuit at the transmitting end, when a computer device has data to be transmitted and informs the NIC, the NIC reads out the data from a memory of the computer device, stores the data in the transmitting buffer first, and then transmits the data to the network after suitable processing.
From another point of view, for a circuit at a receiving end, when the NIC receives the data from the network, the NIC first stores the data in the receiving buffer, confirms that the data is correct, writes the data into the memory of the computer device, and informs the computer device that the data is delivered from the network. Thus, in a current network environment, behaviors of transmission and reception are independent to each other, so that the transmitting buffer and receiving buffer are designed separately to avoid mutual data interference.
However, since electronic products have higher power saving demands, the duration required for a computer device to return to a work mode from a power-saving mode has become longer. The receiving buffer therefore needs a larger capacity for storing data from the network, in order to prevent data loss caused by the capacity of the receiving buffer being filled by the network data before the computer device is able to respond to the demand of the NIC when returning to work mode from power-saving mode. However, even minor increases of the buffer storage capacity incur higher production cost.